package org.activequant.container.report;

import java.util.HashMap;
import java.util.Map;

import org.activequant.core.domainmodel.account.Account;

/**
 * Account Report holds key-value objects related to an account.
 * These key-value objects have to be created in some place,
 * preferably in some AccountReportGenerator. The actual rendering
 * has to be done somewhere else. <br/>
 * The reportValues is initiated upon instantiation of Account Report. <br/>
 * Example of use: report.getReportValues().put("some key","some value");<br/>
 * <br/>
 * An IReport implementation. Holds the following associated variables:
 * <ul>
 * <li>account(Account)</li>
 * <li>reportValues(Map&lt;String, String&gt;)</li>
 * </ul>
 * <b>History:</b><br/>
 *  - [22.02.2008] Created (Erik Nijkamp)<br/>
 *  - [16.05.2009] Added documentation (Ulrich Staudinger) <br/>
 *
 *  @author Erik Nijkamp
 *  @author Ulrich Staudinger
 */
public class AccountReport implements IReport {
	/**
	 * private Account account;
	 */
    private Account account;
    /**
     * private Map&lt;String, String&gt; reportValues = new HashMap&lt;String, String&gt;();
     */
    private Map<String, String> reportValues = new HashMap<String, String>();

    /**
     * constructs an AccountReport(IReport implementation) using the given account(Account) to set its associated account(Account)<br/>
     * default constructor.
     * @param account the account for which this report is valid.
     */
    public AccountReport(Account account) { 
        this.account = account; 
    }

    /**
     * returns the associated reportValues(Map&lt;String, String&gt;)<br/>
     * plain getter.
     * @return the report values.
     */
    public Map<String, String> getReportValues() {
        return reportValues;
    }

    /**
     * sets the associated reportValues(Map&lt;String, String&gt;) with the given reportValues(Map&lt;String, String&gt;)<br/>
     * plain setter.
     * @param reportValues the report values generated.
     */
    public void setReportValues(Map<String, String> reportValues) {
        this.reportValues = reportValues;
    }

    /**
     * returns the associated account(Account)<br/>
     * plain getter.
     * @return valid account object of this report.
     */
    public Account getAccount() {
        return account;
    }

    /**
     * sets the associated account(Account) with the given account(Account)<br/>
     * plain setter. the passed in object is not cloned (reference is kept).
     * @param account a valid account object of this report.
     */
    public void setAccount(Account account) {
        this.account = account;
    }
    
}